/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUI;

import Manager.Manager;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;
import Global.*;
/**
 *
 * @author littlechild
 */
public class RelatedDialog extends JDialog{
    Manager manager;
    PanelCavas drawCavas;
    public RelatedDialog(Window owner, String title,Manager mg, PanelCavas pc) {
        super(owner,title);
        manager=mg;
        drawCavas=pc;
        this.setModalityType(Dialog.DEFAULT_MODALITY_TYPE);
        this.addWindowListener(new WindowAdapter (){
            @Override
            public void windowClosing(WindowEvent e) {
                RelatedDialog.this.drawCavas.setImage(manager.operate(Global.opNone, null));
                RelatedDialog.this.dispose();
            }
        });
    }
}
